import request from '../../utils/request';

// 专家预约时间段管理相关 API

// 更新专家预约时间段
export const updateExpertSchedule = (data: any) => {
    return request({
        url: '/product/api/expert-schedule',
        method: 'put',
        data
    });
};

// 创建专家预约时间段
export const createExpertSchedule = (data: any) => {
    return request({
        url: '/product/api/expert-schedule',
        method: 'post',
        data
    });
};

// 查询专家预约时间段详情
export const getExpertScheduleDetail = (id: string) => {
    return request({
        url: `/product/api/expert-schedule/${id}`,
        method: 'get'
    });
};

// 删除专家预约时间段
export const deleteExpertSchedule = (id: string) => {
    return request({
        url: `/product/api/expert-schedule/${id}`,
        method: 'delete'
    });
};

// 更新专家预约时间段状态
export const updateExpertScheduleStatus = (id: string, data: any) => {
    return request({
        url: `/product/api/expert-schedule/${id}/status`,
        method: 'put',
        data
    });
};

// 查询可预约时间段
export const getAvailableExpertSchedule = (params: any) => {
    return request({
        url: '/product/api/expert-schedule/available',
        method: 'get',
        params
    });
};

// 批量创建专家预约时间段
export const batchCreateExpertSchedule = (data: any) => {
    return request({
        url: '/product/api/expert-schedule/batch',
        method: 'post',
        data
    });
};

// 批量删除专家预约时间段
export const batchDeleteExpertSchedule = (data: any) => {
    return request({
        url: '/product/api/expert-schedule/batch',
        method: 'delete',
        data
    });
};

// 检查时间段冲突
export const checkExpertScheduleConflict = (params: any) => {
    return request({
        url: '/product/api/expert-schedule/check-conflict',
        method: 'get',
        params
    });
};

// 分页查询专家预约时间段
export const getExpertSchedulePage = (params: any) => {
    return request({
        url: '/product/api/expert-schedule/page',
        method: 'get',
        params
    });
};
